# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-hyper
_pkgname=hyper
pkgver=0.7.0
pkgrel=9
pkgdesc='HTTP/2 for Python.'
arch=('any')
url='https://pypi.org/project/hyper/#files'
license=('MIT')
depends=('python' 'python-h2' 'python-hyperframe' 'python-rfc3986'
         'python-brotlipy')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('dd0e439190f811af1b76508d27c421d6530c0a238cd72132ec1874cce6c655b1e1b168c45378c3f7ecc9a65fbba68c713a5c3c9c6e8b1169134882eca1c6f9eb')

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/$_pkgname-python"
}

